package cc.wanforme.fsync.entity.ws;

import cc.wanforme.fsync.config.restUpload.SimpleProgressTracker;
import cc.wanforme.fsync.entity.po.SyncLog;
import org.springframework.beans.BeanUtils;

public class ProgressVo extends SimpleProgressTracker {

    private SyncLog log;

    public ProgressVo(long sizeTotal) {
        super(sizeTotal);
    }

    public static ProgressVo from(SimpleProgressTracker tracker) {
        ProgressVo vo = new ProgressVo(tracker.getSizeTotal());
        BeanUtils.copyProperties(tracker, vo);
        return vo;
    }

    public void setLog(SyncLog log) {
        this.log = log;
    }

    public SyncLog getLog() {
        return log;
    }
}
